<script setup lang="ts">
import RoomStatus from './components/RoomStatus.vue'
import RoomAction from './components/RoomAction.vue'
import RoomMessage from './components/RoomMessage.vue'
// import { MsgType } from '@/enums'
// import type { Message, TimeMessages } from '@/types/room'
// import {ref} from 'vue'

// const list = ref<Message[]>([])
//   // 聊天记录
//   socket.on('chatMsgList', ({ data }: { data: TimeMessages[] }) => {
//     // 准备转换常规消息列表
//     const arr: Message[] = []
//     data.forEach((item, i) => {
//       arr.push({
//         msgType: MsgType.Notify,
//         msg: { content: item.createTime },
//         createTime: item.createTime,
//         id: item.createTime
//       })
//       arr.push(...item.items)
//     })
//     // 追加到聊天消息列表
//     list.value.unshift(...arr)
//   })

</script>

<template>
  <div class="room-page">
    <cp-nav-bar title="问诊室" />
    <room-status></room-status>
    <room-message :list="list"></room-message>
    <room-action></room-action>
  </div>
</template>

<style lang="scss" scoped>
.room-page {
  padding-top: 90px;
  padding-bottom: 60px;
  min-height: 100vh;
  box-sizing: border-box;
  background-color: var(--cp-bg);
  .van-pull-refresh {
    width: 100%;
    min-height: calc(100vh - 150px);
  }
}
</style>
